﻿@using mscook.mvc;
<div class="pagination" id="pageBreak">
    <ul>
        @if (!ViewData[ViewDataKeys.CURRENT_PAGE].ToString().Equals("1"))
        {
            var prePage = Int32.Parse(ViewData[ViewDataKeys.CURRENT_PAGE].ToString()) - 1;
            // var href = ViewData[ViewDataKeys.HRRF].ToString() + prePage;
            <li class="prev"><a data-num="@prePage" href="#">← 上一页</a></li>
        }
        else
        {
            <li class="prev disabled"><a href='#'>← 上一页</a></li>
        }

        <!--显示“页数”的样式-->
        @for (var i = 0; i < ViewBag.PageList.Length; i++)
        {
            var item = ViewBag.PageList[i];
            if (!item.ToString().Equals("0"))
            {
                if (ViewData[ViewDataKeys.CURRENT_PAGE].ToString().Equals(item.ToString()))
                {
            <li class="active"><a href="#">@item</a></li>
                }
                else
                {
                    // var href = ViewData[ViewDataKeys.HRRF].ToString() + item;
            <li><a href="#" data-num="@item">@item</a></li>
                }
            }
        }

        <!--显示“下一页”的样式-->
        @if (!ViewData[ViewDataKeys.TOTAL_PAGE].ToString().Equals("0") && !ViewData[ViewDataKeys.CURRENT_PAGE].ToString().Equals(ViewData[ViewDataKeys.TOTAL_PAGE].ToString()))
        {
            var nextPage = Int32.Parse(ViewData[ViewDataKeys.CURRENT_PAGE].ToString()) + 1;
            //  var href = ViewData[ViewDataKeys.HRRF].ToString() + nextPage;
            <li class="prev"><a href="#"  data-num="@nextPage">下一页 →</a></li>
                   
        }
        else
        {
            <li class="next disabled"><a href="#">下一页 →</a></li>
        }
        <li>
            <div class="text">共 @Html.Encode(ViewData[ViewDataKeys.TOTAL_PAGE]) 页，到第<input id="jumpPage" value="@ViewData[ViewDataKeys.CURRENT_PAGE]" />页</div>
        </li>
        <li><a id="pageJumpSure" href="#">确定</a></li>
    </ul>
</div>


